﻿namespace SeedObject
{
    using Serializable = System.SerializableAttribute;
    //List maintained by the initial value of the attributes of seeds
    [Serializable]
    internal sealed class Attributes : System.Collections.Generic.Dictionary<ID, object>
    {
        public Attributes(int capacity)
            : base(capacity) 
        {
        }
        public Attributes(System.Runtime.Serialization.SerializationInfo info,
            System.Runtime.Serialization.StreamingContext context) :
            base(info, context) 
        { 
        }
        //Redefine the Add method returning the success of the operation of adding
        public new bool Add(ID key, object value)
        {
            if (ContainsKey(key)) 
                return false;
            base.Add(key, value);
            return true;            
        }
    }
}
